package com.sllx.userManage.dao.impl;

import java.util.List;


import com.sllx.core.dao.BaseDao;
import com.sllx.userManage.dao.UserDao;
import com.sllx.userManage.entity.User;

public class UserDaoImpl extends BaseDao implements UserDao{
	
	@Override
	public boolean exists(User user) {
		return hibernateTemplate.find("from User where userId="+user.getUserId()).size()>0;
	}

	@Override
	public void save(User user) {
		hibernateTemplate.save(user);
	}

	@Override
	public List<User> findUsers() {
		return hibernateTemplate.find("from User");
	}

	@Override
	public void deleteUser(User user) {
		hibernateTemplate.delete(user);
	}

}
